<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<meta name="decorator" content="moduleEdit" />
<script type="text/javascript" src="${staticPath}/js/brand.js"></script>
<script type="text/javascript">
	$(function() {
		$("#supplierReviewForm").validate(
				{
					submitHandler : function(form) {
						Oosp_Loading('正在提交，请稍等...');
						returnCheckedNos();
						form.submit();
					},
					errorContainer : "#messageBox",
					errorPlacement : function(error, element) {
						$("#messageBox").text("输入有误，请先更正。");
						if (element.is(":checkbox") || element.is(":radio")
								|| element.parent().is(".input-append")) {
							error.appendTo(element.parent().parent());
						} else {
							error.insertAfter(element);
						}
					}
				});
		showShopList();
	});
	function openWin(url){
		var returnValue = openTempleteSelector(url,680,600);
		$("#supplierBrandId").val(returnValue.supplierId);
		$("#reviewText").val(returnValue.supplierCname+"/"+returnValue.brandCname+"/"+returnValue.cateName);
	}
	
	function showShopList()
	{
		var id = $("#id").val();
		if(null == id || id.length < 1){
			id = "ALL";
		}
		loadShopData('/biz/brand/supplierReview/'+id+'/getShopList');
	}
</script>
</head>
<body>
<div class="Report_f">
           <div class="Report_f_1">
                <div class="Report_f_title_1">新增评审记录</div>
                <ul class="nav nav-tabs Report_f_title_2">
                    <li><a href="#label_1" data-toggle="tab">基本信息</a></li>
                  </ul>
<!-- Tab panes -->
                  <div class="tab-content Report_f_title_3">
                    <div class="tab-pane active" id="label_1">
                        <div class="Report_f_title_4">
                        <form:form id="supplierReviewForm" modelAttribute="supplierReview" action="${contextPath}/biz/brand/supplierReview/save" method="post" class="form-inline" role="form">
							<form:hidden path="id" id="id"/>
							<form:hidden id="supplierBrandId" path="supplierBrandId"/>
							<form:hidden path="checkinShopNos" id="checkinShopNos"/>
							<tags:message content="${message}" />
                        <div class="f_3">
		                      <div class="form-group col-xs-12">
								<label for="reviewText" class="col-lb-1 control-label f_10">选择评审项:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<div class="input-group">
										<c:choose>
											<c:when test="${supplierReview.id != null}">
												<input id="reviewText" name="reviewText" value="${supplierReview.supplierCname}/${supplierReview.brandCname}/${supplierReview.cateName}" readonly="readonly" class="f_5 required"/>
											</c:when>
											<c:otherwise>
												<input id="reviewText" name="reviewText" readonly="readonly" class="f_5 required"/>
											</c:otherwise>
										</c:choose>
										<span class="input-group-btn">
											<a class="btn btn-default btn_3" href="#" onclick="openWin('${contextPath}/biz/brand/supplierBrand/dialoglist')">选择</a>
										</span>
								    </div>
								</div>
							 </div>
						  </div>
                        <div class="f_2">
								<div class="form-group col-sm-6">
	                                   <label for="reviewNo" class="col-sm-3 control-label f_4">评审编号:</label>
	                                   <div class="col-sm-9 f_6">
	                                  	 <form:input id="reviewNo" path="reviewNo" maxlength="30" class="f_5 required"/>
	                                   </div>
								</div>
								<div class="form-group col-sm-6">
									<label for="reviewDate" class="col-sm-3 control-label f_4">评审日期:</label>
									<div class="col-sm-9 f_6">
										 <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" >
											<input id="reviewDate" readonly="readonly" name="reviewDate" type="text"  class="form-control f_13 required"
												value="<fmt:formatDate value="${supplierReview.reviewDate}" pattern="yyyy-MM-dd"/>"/>
											<span class="input-group-addon f_time"><span class="glyphicon glyphicon-remove"></span></span>
							                 <span class="input-group-addon f_time"><span class="glyphicon glyphicon-calendar"></span></span>
						                 </div>
									</div>
								</div>
                          </div>
                           <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="supplierLevelId" class="col-sm-3 control-label f_4">供应商等级:</label>
									<div class="col-sm-9 f_6">
									<ossp:select dictType="SUPPLIER_LEVEL" value="${supplierReview.supplierLevelId}" name="supplierLevelId" id="supplierLevelId" class_="f_5 required"></ossp:select>
									</div>
								</div>
                          </div>
                          <div class="f_2">
								<div class="form-group col-sm-6">
									<label for="isMgtscopeRight" class="col-sm-3 control-label f_4">覆盖范围是否正确:</label>
									<div class="col-sm-9 f_6">
										<ossp:radio dictType="YESORNO" defaultChecked="0" value="${supplierReview.isMgtscopeRight }" name="isMgtscopeRight"id="isMgtscopeRight"></ossp:radio>
									</div>
								</div>
								<div class="form-group col-sm-6">
	                                   <label for="isProxyRight" class="col-sm-3 control-label f_4">供应商属性是否正确:</label>
	                                   <div class="col-sm-9 f_6">
											<ossp:radio dictType="YESORNO" defaultChecked="0" value="${supplierReview.isProxyRight }" name="isProxyRight"id="isProxyRight"></ossp:radio>
	                                   </div>
								</div>
                          </div>
                          <div class="f_2">
								<div class="form-group col-sm-6">
	                                   <label for="isTargetSupplier" class="col-sm-3 control-label f_4">是否目标战略供应商:</label>
	                                   <div class="col-sm-9 f_6">
											<ossp:radio dictType="YESORNO" defaultChecked="0" value="${supplierReview.isTargetSupplier }" name="isTargetSupplier"id="isTargetSupplier"></ossp:radio>
	                                   </div>
								</div>
								<div class="form-group col-sm-6">
									<label for="isStorage" class="col-sm-3 control-label f_4">是否入库:</label>
									<div class="col-sm-9 f_6">
				    					<ossp:radio dictType="YESORNO" defaultChecked="0" value="${supplierReview.isStorage }" name="isStorage"id="isStorage"></ossp:radio>
									</div>
								</div>
                          </div>
                          <div class="f_2">
		                      <div class="form-group col-xs-12">
								<label for="checkedShop" class="col-lb-1 control-label f_10">可合作门店:</label>
								<div class="col-sm-10 col-lb-2 f_6">
									<table id="shopData" class="table table-bordered" >
									</table>
								</div>
							 </div>
						  </div>
						  <div class="f_3">
			                      <div class="form-group col-xs-12">
									<label for="reviewResult" class="col-lb-1 control-label f_10">评审结论:</label>
									<div class="col-sm-10 col-lb-2 f_6">
										<form:textarea id="reviewResult" path="reviewResult" class="form-control f_11"  maxlength="300"/>
									</div>
								 </div>
							</div>
	                 	  <div class="f_12">
	                            <button type="button" class="btn btn-danger btn_5 btn_right" onclick="history.go(-1)">返&nbsp;回</button>
	                            <button type="submit" class="btn btn-success btn_5 btn_right">保&nbsp;存</button>
	                      </div>
                  </form:form>
              </div>
		  </div>
		</div>	
	</div>
</div>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>
	<script type="text/javascript">
	$('.form_date').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd',
		pickerPosition: "bottom-left"
    });
</script>
</body>
</html>